package cn.lmxdev.ptms.dao;

import cn.lmxdev.ptms.bean.table.TUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface IUserDao {
    /* 插入 */
    boolean insert(@Param(value = "user") TUser user);

    /* 删除 */
    boolean delete(@Param(value = "id") Long id);

    /* 更新 */
    boolean update(@Param(value = "user") TUser user);

    /* 查询 */
    TUser find(@Param(value = "id") Long id);

    /* 根据账号查询 */
    TUser findByAccount(@Param(value = "account") String account);

    /* 计数 */
    long count(@Param(value = "user") TUser user);

    /* 查询列表 */
    List<TUser> select(@Param(value = "limitStart") Long limitStart, @Param(value = "limitEnd") Long limitEnd, @Param(value = "user") TUser user);

    /* 计数教师 */
    long countByTeacher(@Param(value = "user") TUser user);

    /* 查询列表教师 */
    List<TUser> selectByTeacher(@Param(value = "limitStart") Long limitStart, @Param(value = "limitEnd") Long limitEnd, @Param(value = "user") TUser user);

    /* 学院负责人计数教师 */
    long departmentHeadCountByTeacher(@Param(value = "departmentHeadId") Long departmentHeadId, @Param(value = "user") TUser user);

    /* 学院负责人查询列表教师 */
    List<TUser> departmentHeadSelectByTeacher(@Param(value = "departmentHeadId") Long departmentHeadId, @Param(value = "limitStart") Long limitStart, @Param(value = "limitEnd") Long limitEnd, @Param(value = "user") TUser user);

    /* 专业负责人计数教师 */
    long specialtyHeadCountByTeacher(@Param(value = "specialtyHeadId") Long specialtyHeadId, @Param(value = "user") TUser user);

    /* 专业负责人查询列表教师 */
    List<TUser> specialtyHeadSelectByTeacher(@Param(value = "specialtyHeadId") Long specialtyHeadId, @Param(value = "limitStart") Long limitStart, @Param(value = "limitEnd") Long limitEnd, @Param(value = "user") TUser user);

    /* 学院负责人计数学生 */
    long departmentHeadCountByStudent(@Param(value = "departmentHeadId") Long departmentHeadId, @Param(value = "user") TUser user);

    /* 学院负责人查询列表学生 */
    List<TUser> departmentHeadSelectByStudent(@Param(value = "departmentHeadId") Long departmentHeadId, @Param(value = "limitStart") Long limitStart, @Param(value = "limitEnd") Long limitEnd, @Param(value = "user") TUser user);

    /* 专业负责人计数学生 */
    long specialtyHeadCountByStudent(@Param(value = "specialtyHeadId") Long specialtyHeadId, @Param(value = "user") TUser user);

    /* 专业负责人查询列表学生 */
    List<TUser> specialtyHeadSelectByStudent(@Param(value = "specialtyHeadId") Long specialtyHeadId, @Param(value = "limitStart") Long limitStart, @Param(value = "limitEnd") Long limitEnd, @Param(value = "user") TUser user);

    /* 指导老师计数学生 */
    long adviserCountByStudent(@Param(value = "adviserId") Long adviserId, @Param(value = "user") TUser user);

    /* 指导老师查询列表学生 */
    List<TUser> adviserSelectByStudent(@Param(value = "adviserId") Long adviserId, @Param(value = "limitStart") Long limitStart, @Param(value = "limitEnd") Long limitEnd, @Param(value = "user") TUser user);

    /* 是否存在 */
    boolean has(@Param(value = "id") Long id);
}
